<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>Document</title>

<style>
    .container {
        width: 100%;
    }
    .content {
        width: 50%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 50vh;
        font-family: Arial, sans-serif;

        background-image: linear-gradient(to right, #abd6f6, #a4ee8a);
        border-radius: 10px;
        box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    }
    @media (max-width: 600px) {
        .content {
            width: 100%;
            height: 100vh;
        }
    }
    label {
        background-color: #4CAF50;
        border: none;
        color: white;
        padding: 15px 32px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
        margin: 4px 2px;
        cursor: pointer;
        border-radius: 4px;
    }
    input[type="button"] {
        background-color: #008CBA;
        border: none;
        color: white;
        padding: 15px 50px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
        margin: 4px 2px;
        cursor: pointer;
        border-radius: 4px;
    }
    .address {
        width: 100%;
        background-color: #abd6f6;
    }
</style>
</head>
<body>
<div class="container">
    <div class="content">
        <div class="formDiv">
            <input id="file" name="mov" type="file" value="选择文件"/>
            <div id="progressBar"></div>
            <div>
                <input id="btn" type="button" value="上传"/>
                <input id="btn1" type="button" value="暂停"/>
            </div>
            <textarea rows="3" class="address" id="address" style="display: none"></textarea>
        </div>

    </div>
</div>



<script src="fileSliceUpload.js"></script>
<script type="module">

    // let testingUrl = "http://localhost:8080/testing"
    // let uploadUrl = "http://localhost:8080/uploads"
    // let margeUrl = "http://localhost:8080/merge-file-slice"
    let testingUrl = "http://47.103.10.54:8080/testing"
    let uploadUrl = "http://47.103.10.54:8080/uploads"
    let margeUrl = "http://47.103.10.54:8080/merge-file-slice"
    let fileSliceUpload = new FileSliceUpload(testingUrl, uploadUrl, margeUrl, "#file")
    fileSliceUpload.addProgress("#progressBar")
    let btn = document.querySelector("#btn")
    let btn1 = document.querySelector("#btn1")
    btn.addEventListener("click", function () {
        fileSliceUpload.startUploadFile()
    })
    btn1.addEventListener("click", function () {
        fileSliceUpload.stopUploadFile()
    })
    let address = document.getElementById("address");
    address.addEventListener('click', function() {
        this.select();
    });
</script>
</body>
</html>
